package cn.itcast.mapper;

import cn.itcast.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @Author GuoMingXi @Email guomingxi2018@163.com
 * @Create 2022/6/1 17:06
 * @Version V1.0
 */
public interface IDishFlavorMapper {
    @Insert("insert into dish_flavor values(null,#{dishId},#{name},#{value},#{createTime},#{updateTime}" +
            ",#{createUser},#{updateUser},0)")
    void Save(DishFlavor dishFlavor);

    @Select("select * from dish_flavor where dish_id=#{id}")
    List<DishFlavor> findByDishId(Long id);


    @Delete("delete from dish_flavor where dish_id=#{id}")
    void deleteByDishId(Long id);
}
